// 练习3：实现一个函数ex3，使用safeProp和fp.first找到user 的名字的首字母

const fp = require("lodash/fp");
const { Maybe, Container } = require("./support");

const safeProp = fp.curry(function (x, o) {
  return Maybe.of(o[x]);
});

const user = { id: 2, name: "Albert" };

const ex3 = () => {
  console.log(safeProp("name")(user).map(fp.first));
};


